{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas\n",
    "fileurl = '2020ad.csv'\n",
    "df_ad = pandas.read_csv(fileurl, encoding=\"utf-8\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "nameLists = df_ad['姓名'].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "余娇\n",
      "江中诚\n",
      "冉小军\n",
      "夏平琴\n",
      "杨凯岑\n",
      "崔山林\n",
      "冉西谊\n",
      "王霞\n",
      "肖玲玲\n",
      "马有花\n",
      "沙珂鑫\n",
      "文怡心\n",
      "王佳宁\n",
      "王海燕\n",
      "王文阳\n",
      "胡文静\n",
      "杨芸\n",
      "曾霈婷\n",
      "李建晴\n",
      "沙容容\n",
      "陆覃慧\n",
      "刘雨欣\n",
      "梁爽\n",
      "吴倩\n",
      "杨佳骏\n",
      "郭璇\n",
      "韦丹丹\n",
      "王隆琴\n",
      "李爱翠\n",
      "盖馨月\n",
      "崔维\n",
      "冯静仪\n",
      "马晓炜\n",
      "韦燕芬\n",
      "张思凡\n",
      "仲格尔吉\n",
      "潘小燕\n",
      "傅加雨\n",
      "马小春\n",
      "李同\n",
      "和鎏\n",
      "郭善鑫\n",
      "马芳甜\n",
      "马扬\n",
      "朱襄竹\n",
      "邓林云\n",
      "马梦飞\n",
      "刘睿奕\n",
      "董丽缘\n",
      "王艺豪\n",
      "周銮\n",
      "西仁娜依·阿布来克\n",
      "李晓燕\n",
      "李睿麒\n",
      "宋昕忆\n",
      "苏丽华\n",
      "刘星宇\n",
      "张兴乐\n",
      "邹雅婷\n",
      "隆文航\n",
      "乔轩\n",
      "张湘粤\n",
      "马玉红\n",
      "闭明阳\n",
      "司雨航\n",
      "张双\n",
      "龙云荟\n",
      "郭嘉宇\n",
      "韦大明\n",
      "拥倩卓玛\n",
      "艾力飞热·艾尼玩\n",
      "陆胜减\n",
      "郭育汝\n",
      "禹小双\n",
      "刘素玲\n",
      "吕小艳\n",
      "吴亦杰\n",
      "王一凡\n",
      "李苑萌\n",
      "曹凡\n",
      "方欣\n",
      "zhou l q\n",
      "韦茜茜\n",
      "王钰湘\n"
     ]
    }
   ],
   "source": [
    "for i in nameLists:\n",
    "  print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "count = df_ad[df_ad['姓名'] == '余娇'].shape[0]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "result ={'姓名':nameLists,'次数':[]}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for name in nameLists:\n",
    "  count = df_ad[df_ad['姓名'] == name].shape[0]\n",
    "  print(name,count)\n",
    "  result['次数'].append(count)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "余娇     3\n",
       "王海燕    2\n",
       "周銮     2\n",
       "郭善鑫    2\n",
       "潘小燕    2\n",
       "      ..\n",
       "盖馨月    1\n",
       "李爱翠    1\n",
       "王隆琴    1\n",
       "韦丹丹    1\n",
       "王钰湘    1\n",
       "Name: 姓名, Length: 84, dtype: int64"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_ad['姓名'].value_counts()"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
  },
  "kernelspec": {
   "display_name": "Python 3.9.1 64-bit",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.1"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
